package com.sunyard.dal.bo;


import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import java.io.Serializable;


/**
 * @Description: 分页查询参数分装实体类
 * @Author: huix.Liang
 * @Date: 2019-07-11 10:11
 */
@ApiModel(value = "分页查询参数")
public class PaginationBO<T> implements Serializable {

    private static final long serialVersionUID = -117683524064797108L;

    /**
     * @Fields pageNo : 当前页
     */
    @ApiModelProperty(value = "当前页")
    private int pageNo = 1;
    /**
     * @Fields pageSize : 每页显示条数
     */
    @ApiModelProperty(value = "每页显示条数")
    private int pageSize = 10;

    private int maxPageSize = 50;

    @Valid
    @ApiModelProperty(value = "分页查询参数实体")
    private T params;

    public PaginationBO(Integer pageNo, Integer pageSize, T params) {
        this.pageNo = pageNo;
        this.pageSize = pageSize;
        this.params = params;
    }

    public PaginationBO(Integer pageNo, Integer pageSize) {
        super();
        this.pageNo = pageNo;
        this.pageSize = pageSize;
    }

    public PaginationBO() {
        super();
    }


    public int getPageNo() {
        return pageNo;
    }

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getMaxPageSize() {
        return maxPageSize;
    }

    public void setMaxPageSize(int maxPageSize) {
        this.maxPageSize = maxPageSize;
    }

    public T getParams() {
        return params;
    }

    public void setParams(T params) {
        this.params = params;
    }
}
